from keras.datasets import mnist
from matplotlib import colors, pyplot

(x_train,y_train),(x_test,y_test) = mnist.load_data()

for i in range(0,9):
    ax = pyplot.subplot(330+1+i)
    pyplot.tight_layout()
    ax.tick_params(axis='x',colors='white')
    ax.tick_params(axis='y',colors='white')
    pyplot.imshow(x_train[i],cmap=pyplot.get_cmap('gray'))
pyplot.show()